   // var urlcom = 'http://192.168.0.225:8181/api/'
var urlcom = 'http://139.9.169.213/api/'
//倒计时
var countdown=60;  
var _generate_code = $(".getcode");  
function settime() { 
  if (countdown == 0) {  
  	
    _generate_code.attr("disabled",false);  
    _generate_code.val("获取验证码");  
    countdown = 60;  
    return false;  
  } else {  
  	  
    $(".getcode").attr("disabled", true);  
    _generate_code.val("重新发送(" + countdown + ")");  
        countdown--;  
    }  
    setTimeout(function() {  
        settime();  
    },1000);  
}
//get 获取页面id
//function getUrlParam(name) {
//	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
//	var r = window.location.search.substr(1).match(reg); //匹配目标参数
//	if(r != null) return unescape(r[2]);
//	return null; //返回参数值
//}


function getUrlParam(name) {   
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象  
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if( r != null ) return decodeURI( r[2] ); return null;   
}
//小弹窗
function msg(msg) {
	$(".msg-spring").fadeIn(200).text(msg);
	$(".msg-spring").delay(1000).fadeOut();
}

$('body').append('<div class="msg-spring"></div>')
$('body').append('<div class="gif"><img src="images/1.gif"/></div>')
//mui.toast(res.msg)
var userid = localStorage.getItem('userId')

if(!userid){
	 msg('去登陆')
	 setTimeout(function(){
	 	window.location.href = 'login.html'
	 },1000)
}
